﻿using System;
using System.Collections;
using ModuleUnitData;
using UnityEngine;


/// <summary>
/// 
/// </summary>
public class ModuleExample : MonoBehaviour, ITData<DataExample>
{
    public DataExample Data { get; set; }

    public event Action<DataExample> OnTDataUpdated;

    public event Action<object> OnDataUpdated;




    IEnumerator Start()
    {
        while (true)
        {
            this.Data = DataExample.Example;
            this.OnTDataUpdated?.Invoke(this.Data);
            this.OnDataUpdated?.Invoke(this.Data);

            yield return new WaitForSeconds(1f);   
        }
    }
}